﻿
USE master
go
--创建数据库
create database WebastoServer
ON PRIMARY
( NAME =WebastoServer,
  FILENAME = 'D:\Database\Webasto\WebastoServer.mdf',
  SIZE = 20MB,
  MAXSIZE = 100MB,
  FILEGROWTH = 20%
)
LOG ON
( NAME = WebastoServerLog,
  FILENAME = 'D:\Database\Webasto\WebastoServer.ldf',
  SIZE = 5MB,
  MAXSIZE = 50MB,
  FILEGROWTH = 1MB
)
go
CREATE TABLE Webasto
(
	cpn varchar(50) primary key,--客户零件号
	ipn varchar(50) not null,--内部零件号
	importTime datetime default getdate(),--导入时间
)
go
create table userMgmt
(
	UserNumber varchar(10) PRIMARY KEY,--用户账号
	UserName varchar(10) not null,--用户姓名
	UserPwd varchar(20) not null,--用户密码
	privs int default 0,
)
go
CREATE TABLE Operation
(
	ID int identity(1,1) primary key,
	cpn varchar(50),
	ipn varchar(50) not null,
	operTime datetime default getdate()
)